import request from '@/router/axios'

//  分页获取代金券数据列表
export function getVouchersPage(query) {
  return request({
    url: '/eims/vouchers/page',
    method: 'get',
    params: query
  })
}

//  新增代金券
export function addVouchers(obj) {
  return request({
    url: '/eims/vouchers',
    method: 'post',
    data: obj
  })
}

//  根据ID获取代金券信息
export function getVouchers(id) {
  return request({
    url: '/eims/vouchers/' + id,
    method: 'get'
  })
}

//  删除代金券
export function delVouchers(id) {
  return request({
    url: '/eims/vouchers/' + id,
    method: 'delete'
  })
}

//  更新代金券信息
export function updateVouchers(obj) {
  return request({
    url: '/eims/vouchers',
    method: 'put',
    data: obj
  })
}

//  批量新增代金券
export function addBatchVouchers(obj) {
  return request({
    url: '/eims/vouchers/batchAddNew',
    method: 'post',
    data: obj
  })
}
